﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Signage01
{
    [Serializable]
    public class Timeline :INotifyPropertyChanged
    {
        private List<Channel> _listChannel;

        public List<Channel> ListChannel
        {
            get { return _listChannel; }
            set { _listChannel = value; }
        }

        // the Sequence property needed if we get the sequence option, we intend to implement the scheduler 
        // option later, so initially the property will be -1

        private int _sequence;  
        public int Sequence
        {
            get { return _sequence; }
            set { _sequence = value; }
        }


        public Timeline()
        {
            _listChannel = new List<Channel>();
            this.Sequence = -1;
        }


        private String _name;
        public String Name
        {
            get { return _name; }
            set { _name = value; NotifyPropertyChanged("Name"); }
        }
        

        private int hr;
        public int Hr
        {
            get { return hr; }
            set { hr = value; NotifyPropertyChanged("Hr"); }
        }


        private int min;
        public int Min
        {
            get { return min; }
            set { min = value; NotifyPropertyChanged("Min"); }
        }

        private int sec;
        public int Sec
        {
            get { return sec; }
            set { sec = value; NotifyPropertyChanged("Sec"); }
        }

        
        private ScreenTemplate scTemplate;
        public ScreenTemplate ScTemplate
        {
            get { return scTemplate; }
            set 
            { 
                scTemplate = value; 
                NotifyPropertyChanged("ScTemplate");
                
            }
        }
        
        private bool isSelected;
        public bool IsSelected
        {
            get { return this.isSelected; }
            set
            {
                if (value != this.isSelected)
                {
                    this.isSelected = value;
                    NotifyPropertyChanged("IsSelected");
                    
                }
            }
        }

        [field: NonSerialized]
        public event PropertyChangedEventHandler PropertyChanged;

       
        public void NotifyPropertyChanged(string propName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }
         
    }
}
